home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
039a
/
rmtc01.zip
/
WRITEDEF.C
< prev
Wrap
Text File
|
1991-11-02
|
1KB
|
47 lines
/* ************************************************ */
/* WriteDef.c */
/* Purpose : Creates a DEF file */
/* Compiler: Turbo C V2.0 */
/* Date : Oct 31, 1991 */
/* ************************************************ */
#include <graphics.h>
#include <stdio.h>
#include <alloc.h>
main()
{
FILE *F;
int driver, mode, size;
int x, y, x2, y2, i, j;
int Col;
driver=EGA;
mode=EGAHI;
initgraph(&driver, &mode, ""); /* Set path to your EGAVGA.BGI */
setcolor(WHITE);
rectangle(300,120,349,169);
setfillstyle(SOLID_FILL,LIGHTBLUE);
bar(301,121,348,168);
setfillstyle(SOLID_FILL,YELLOW);
bar(311,122,321,141);
setfillstyle(SOLID_FILL,LIGHTGREEN);
bar(331,151,346,166);
x=300;
y=120;
x2=349;
y2=169;
F=fopen("sample.def","w"); /* Sample.def will be in the */
for (j=y;j<y2+1;j++) /* current directory. */
{
for (i=x;i<x2+1;i++)
{
Col=getpixel(i,j);
fprintf(F,"%X",Col);
}
fprintf(F,"\n");
}
fclose(F);
getch();
closegraph();
}